import { Card, List } from 'antd';
import MyInnerCard from './MyInnerCard';
import './MyCard.css';
const MyCar = prop => {
  const { title, graphs } = prop;
  const data = graphs.map((item, index) => {
    return {
      matrixAndLabels: {
        matrix: item.matrix,
        labels: item.labels,
      },
      networkId: index + 1,
      modularity: item.modularity,
      nodeNum: item.matrix.length,
      targetFunction: item.targetFunction === 'H' ? '不平衡度' : '模块度',
    };
  });
  return (
    <Card style={{ marginTop: 0 }} type="inner" title={title}>
      <List
        grid={{ gutter: 16, column: 3 }}
        dataSource={data}
        renderItem={item => (
          <List.Item>
            <MyInnerCard {...item} />
          </List.Item>
        )}
      />
    </Card>
  );
};
export default MyCar;
